﻿@model Abmemunit.Web.Models.UserViewModel
@{
    ViewBag.Title = "Edit";
}
@{
    Html.RenderAction("MenuView", "User");             
}

<div id="add-Status-message">
</div>
<div id="ContentBody">
    @using (Ajax.BeginForm("Edit", "User", null,
        new AjaxOptions
        {
            UpdateTargetId = "add-Status-message",
            InsertionMode = InsertionMode.Replace,
            HttpMethod = "POST",
            OnSuccess = "addTStatusSuccess"
            
        }, new { @id = "addTStatusForm" }))
    { 



        <fieldset>
            <legend>Edit User</legend>
            @Html.HiddenFor(model => model.Id)
            <div class="from_row">
                <div class="form_lebel">
                    @Html.LabelFor(m => m.Username)</div>
                <div class="form_field">
                    @Html.DisplayFor(m => m.Username)
                </div>
            </div>
            <div class="from_row">
                <div class="form_lebel">
                    @Html.LabelFor(m => m.Email)</div>
                <div class="form_field">
                    @Html.EditorFor(m => m.Email)
                </div>
            </div>
            <div class="from_row">
                <div class="form_lebel">
                    @Html.LabelFor(m => m.IsAdminAccount)</div>
                <div class="form_field">
                    @Html.EditorFor(m => m.IsAdminAccount)
                </div>
            </div>
            <div class="from_row">
                <div class="form_lebel">
                    @Html.LabelFor(m => m.MailingAddress)</div>
                <div class="form_field">
                    @Html.EditorFor(m => m.MailingAddress)
                </div>
            </div>
            <div class="from_row">
                <div class="form_lebel">
                    @Html.LabelFor(m => m.Active)</div>
                <div class="form_field">
                    @Html.EditorFor(m => m.Active)
                </div>
            </div>
            <p>
                <input type="submit" value="Update" />
            </p>
        </fieldset>

        <script type="text/javascript">
            function addTStatusSuccess() {
                $(document).ready(function () {

                    $("#idprog").hide();
                    alert("Success");

                });
            }


        </script>
    }
</div>
